package com.leaguefox.web.client.common;


import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Widget;
import com.leaguefox.web.shared.domain.dto.PlayerDto;

@SuppressWarnings("serial")
public class PlayersTableCellRendererImpl extends TableCellRenderer<PlayerDto> {

	@Override
	public Widget render(int row, int column, PlayerDto player) {
		switch (column) {
		case 0:
			return new CheckBox();
		case 1:
			return new HTML("<div id='" + player.getId().toString() + "'>"
					+ player.getSurname() + "</div>");
		default:
			throw new IllegalArgumentException("No such column definition: " + column); 
		}
	}
}
